// 全部都是 api
// 引入路由 koa-router
const router = require("koa-router")()

// 引入 controller
const {
    userApi
} = require("../../../controller/user/user")

// 引入权限验证中间件
const { check } = require("../../../middleware/routercheck")

router.post("/login", userApi)
// router.post("/logout", userApi)
router.get("/user", check("getuser"), userApi)
router.get("/user/:id", check("getuser"), userApi)
router.get("/searchuser", check("getuser"), userApi) // 模糊查询
router.post("/user", check("createuser"), userApi) // 添加用户
router.put("/user/:id", check("edituser"), userApi)
router.delete("/user/:id", check("removeuser"), userApi)

module.exports = router